﻿using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Screens2.Renders.ViewModel
{
    public class EntityUpdateScreenRenderer : IEntityUpdateScreenRenderer
    {
        public void RenderParentClass(EntityUpdateScreen control, CodeWriter writer)
        {
            writer.Write(string.Format("UpdateEntityViewModel<{0}Model, {0}Entity>", control.EntityName));
        }


        public void RenderCode(EntityUpdateScreen control, CodeWriter writer)
        {
            writer.Write(string.Format(@"
        public {0}UpdateEntityViewModel()
            : base(null)
        {{
        }}

        public {0}UpdateEntityViewModel({0}ModelParameters parameters)
            : base(parameters)
        {{
        }}
", control.EntityName));
        }

        public void RenderControls(EntityUpdateScreen control, CodeWriter writer)
        {
            control.Controls.RenderViewModelCs(writer);
        }

    }
}
